package com.junzhiit.nengji.cms.web.util.excel.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum WorkbookType {
	
	HSSFWORKBOOK(0),
	XSSFWORKBOOK(1);
	
	private Integer value;

	private WorkbookType(Integer value) {
		this.value = value;
	}

	public int toIntValue() {
		return this.value;
	}


	public static WorkbookType toType(int value) {
		if (HSSFWORKBOOK.value == value) {
			return HSSFWORKBOOK;
		} else if (XSSFWORKBOOK.value == value) {
			return XSSFWORKBOOK;
		}else {
			throw new InvalidArgumentException("Unknown WorkbookType[" + value + "].");
		}
	}
}
